/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_transferencia_detalle")
@NamedQueries({
    @NamedQuery(name = "FarTransferenciaDetalle.findAll", query = "SELECT f FROM FarTransferenciaDetalle f")})
public class FarTransferenciaDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ftd_id")
    private Integer ftdId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ftd_cantidad")
    private int ftdCantidad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ftd_estado")
    private int ftdEstado;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "ftd_total")
    private BigDecimal ftdTotal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ftd_valor_unitario")
    private BigDecimal ftdValorUnitario;
    @JoinColumn(name = "ftr_id", referencedColumnName = "ftr_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarTransferencia farTransferencia;
    @JoinColumn(name = "fsk_id", referencedColumnName = "fsk_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarStock farStock;

    public FarTransferenciaDetalle() {
    }

    public FarTransferenciaDetalle(Integer ftdId) {
        this.ftdId = ftdId;
    }

    public FarTransferenciaDetalle(Integer ftdId, int ftdCantidad, int ftdEstado, BigDecimal ftdTotal, BigDecimal ftdValorUnitario) {
        this.ftdId = ftdId;
        this.ftdCantidad = ftdCantidad;
        this.ftdEstado = ftdEstado;
        this.ftdTotal = ftdTotal;
        this.ftdValorUnitario = ftdValorUnitario;
    }

    public Integer getFtdId() {
        return ftdId;
    }

    public void setFtdId(Integer ftdId) {
        this.ftdId = ftdId;
    }

    public int getFtdCantidad() {
        return ftdCantidad;
    }

    public void setFtdCantidad(int ftdCantidad) {
        this.ftdCantidad = ftdCantidad;
    }

    public int getFtdEstado() {
        return ftdEstado;
    }

    public void setFtdEstado(int ftdEstado) {
        this.ftdEstado = ftdEstado;
    }

    public BigDecimal getFtdTotal() {
        return ftdTotal;
    }

    public void setFtdTotal(BigDecimal ftdTotal) {
        this.ftdTotal = ftdTotal;
    }

    public BigDecimal getFtdValorUnitario() {
        return ftdValorUnitario;
    }

    public void setFtdValorUnitario(BigDecimal ftdValorUnitario) {
        this.ftdValorUnitario = ftdValorUnitario;
    }

    public FarTransferencia getFarTransferencia() {
        return farTransferencia;
    }

    public void setFarTransferencia(FarTransferencia farTransferencia) {
        this.farTransferencia = farTransferencia;
    }

    public FarStock getFarStock() {
        return farStock;
    }

    public void setFarStock(FarStock farStock) {
        this.farStock = farStock;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ftdId != null ? ftdId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarTransferenciaDetalle)) {
            return false;
        }
        FarTransferenciaDetalle other = (FarTransferenciaDetalle) object;
        if ((this.ftdId == null && other.ftdId != null) || (this.ftdId != null && !this.ftdId.equals(other.ftdId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarTransferenciaDetalle[ ftdId=" + ftdId + " ]";
    }
    
}
